package com.fenqing.leetcode.code.t2000_2100;

import com.fenqing.annotations.Execute;
import com.fenqing.core.Topic;

import java.util.ArrayList;
import java.util.List;

public class Topic2194 extends Topic {

    /**
     * 构造器
     *
     * @param input 输入
     */
    public Topic2194(String input) {
        super(input);
    }

    @Execute
    public List<String> cellsInRange(String s) {
        List<String> list = new ArrayList<>();
        char c1 = s.charAt(0), r1 = s.charAt(1), c2 = s.charAt(3), r2 = s.charAt(4);
        for (char c = c1; c <= c2; c++) {
            for (char r = r1; r <= r2; r++) {
                list.add(new String(new char[]{c, r}));
            }
        }
        return list;
    }

    public static void main(String[] args) {
        List<String> run = new Topic2194("A1:B2").run();
        System.out.println(run);
    }

}
